package student_system.Controller;

import student_system.Dao.scdao;
import student_system.bean.sc;
import student_system.bean.student;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/sc_alter1")
public class sc_alter1 extends HttpServlet {
    scdao dao=new scdao();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //super.doGet(req, resp);
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //super.doPost(req, resp);
        String sno=req.getParameter("sno");
        String cno=req.getParameter("cno");
        sc sc=dao.selectbysno2(sno,cno);
        req.setAttribute("sclist",sc);
        RequestDispatcher dispatcher =req.getRequestDispatcher("sc_alter.jsp");
        dispatcher.forward(req,resp);


    }
}
